//
//  HLLabelsViewController.m
//  LearningRoad
//
//  Created by Zhl on 2017/9/13.
//  Copyright © 2017年 LearningRoad. All rights reserved.
//

#import "HLLabelsViewController.h"
#import "HLLabelsView.h"
@interface HLLabelsViewController ()

@end

@implementation HLLabelsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSMutableArray *models = [@[]mutableCopy];
    for (int i = 0; i<7; i++) {
        HLTextModel *model = [[HLTextModel alloc] init];
        model.fontPointSize = 11;
        if ( i==0 ) {
            model.text = @"0足球";
            model.colorHexStr = @"FF0000";
            model.hasRect = @"1";
        }else if ( i==1 ) {
            model.text = @"1热赛";
            model.colorHexStr = @"00FF00";
            model.hasRect = @"1";
        }else if ( i==2 ) {
            model.text = @"2预测";
            model.colorHexStr = @"FF0000";
            model.hasRect = @"0";
        }else if ( i==3 ) {
            model.text = @"3热赛";
            model.colorHexStr = @"00FF00";
            model.hasRect = @"1";
        }else if ( i==4 ) {
            model.text = @"4预测预测";
            model.colorHexStr = @"FF0000";
            model.hasRect = @"0";
        }else if ( i==5 ) {
            model.text = @"5热赛";
            model.colorHexStr = @"0000FF";
            model.hasRect = @"1";
        }else if ( i==6 ) {
            model.text = @"6预测";
            model.colorHexStr = @"00FF00";
            model.hasRect = @"1";
        }
        
        [models addObject:model];
    }
    HLLabelsView *view = [[HLLabelsView alloc] initWithFrame:CGRectMake(10, 100, 180, 100)andTextModels:models];
    CGRect frame = view.frame;
    frame.size.height = [HLLabelsView getLabelsViewHeightWithTextModelArr:models andWidth:frame.size.width];
    view.backgroundColor = [UIColor grayColor];
    view.frame = frame;
    [self.view addSubview:view];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
